package goquery

import 

// Is checks the current matched set of elements against a selector and
// returns true if at least one of these elements matches.
func ( *Selection) ( string) bool {
	return .IsMatcher(compileMatcher())
}

// IsMatcher checks the current matched set of elements against a matcher and
// returns true if at least one of these elements matches.
func ( *Selection) ( Matcher) bool {
	if len(.Nodes) > 0 {
		if len(.Nodes) == 1 {
			return .Match(.Nodes[0])
		}
		return len(.Filter(.Nodes)) > 0
	}

	return false
}

// IsFunction checks the current matched set of elements against a predicate and
// returns true if at least one of these elements matches.
func ( *Selection) ( func(int, *Selection) bool) bool {
	return .FilterFunction().Length() > 0
}

// IsSelection checks the current matched set of elements against a Selection object
// and returns true if at least one of these elements matches.
func ( *Selection) ( *Selection) bool {
	return .FilterSelection().Length() > 0
}

// IsNodes checks the current matched set of elements against the specified nodes
// and returns true if at least one of these elements matches.
func ( *Selection) ( ...*html.Node) bool {
	return .FilterNodes(...).Length() > 0
}

// Contains returns true if the specified Node is within,
// at any depth, one of the nodes in the Selection object.
// It is NOT inclusive, to behave like jQuery's implementation, and
// unlike Javascript's .contains, so if the contained
// node is itself in the selection, it returns false.
func ( *Selection) ( *html.Node) bool {
	return sliceContains(.Nodes, )
}